'use strict';
angular.module('PP.pages.concerti', ['Flickr.services']);

angular.module('PP.pages.concerti').controller('ConcertiCtrl', ['$scope', 'flickrApi', function($scope, flickrApi) {
	$scope.header.concertiPage.select();

	var FOTO_SET_ID = '72157646930723490';
	flickrApi.photosets.getPhotos({
		photoset_id : FOTO_SET_ID
	}, function(data) {
		$scope.photos = [];
		var photos = data.photoset.photo;

		for (var i = 0; i < photos.length; i++) {
			var photo = photos[i];
			$scope.photos.push({
				src : flickrApi.url(photo, 'n'),
				url : flickrApi.url(photo, 'b'),
				title : photo.title
			});
		}
	});

}]);